<?php
namespace app\common\library;
class Insert{
    //构造函数
    public function _initialize(){
		parent::_initialize();
        $domain=getdomain(input('server.HTTP_HOST'));
        $validatekey=$domain."_zanpiancms";
        $validatename=md5(md5($domain)."d.!CAcTx,-%UQp7m!dV$");
        $validatekeys=array('t'=>time(),'code'=>$validatename);
        $validatecache=cache($validatekey);
        $validateurl=base64_decode("aHR0cDovL3lhbnpoZW5nLjk3YmlrZS5jb20vbGljZW5zZS96YW5waWFuY21zLzdlZWRiOGUxMmIyMmU3M2RhM2Y2NjJkYmI0MWRlN2ZiLnR4dA==");
        if(!empty($validatecache['code']) && $validatecache['code']!=$validatename || empty($validatecache['code'])){
	        $ctx = stream_context_create(array('http'=>array('timeout'=>15)));
	        $flag = @stripos(file_get_contents($validateurl,0,$ctx),$validatename);
	        if($flag===false){
	           cache($validatekey,NULL);
	           exit('程序没有授权');
	        }else{
	           cache($validatekey,$validatekeys,259200);
	        }
        }
    }
    public function vod($data){
		return vod($data);	
    }	
    public function news($data){
		return news($data);	
    }
	
    public function star($data){
	    return star($data);	
   }
    public function story($data){
		return story($data);		

   }
   public function story_add($data,$vid){ 
        return story_add($data,$vid);
   } 	
    public function actor($data){
	    return actor($data);
    }
    public function actor_add($data,$vid){
        return actor_add($data,$vid);
   }
	public function Cm($data){
		return Cm($data);
	}
	public function cm_add($data,$vid){
		return cm_add($data,$vid);
	}	       
}
require APP_PATH.'common/library/Insert_sys.php';
